<?php
abstract class Wall_Model_Helper_Abstract
{
  protected $_action;

  public function setAction(Wall_Model_Action $action)
  {
    $this->_action = $action;
    return $this;
  }

  public function getAction()
  {
    return $this->_action;
  }

  public function direct()
  {
    return '';
  }

  protected function _getItem($item, $throw = true)
  {
    if( is_string($item) && strpos($item, '_') !== false )
    {
      $item = explode('_', $item);
    }
    
    if( is_array($item) && count($item) === 2 && is_string($item[0]) && is_numeric($item[1]) )
    {
      $item = Engine_Api::_()->getItem($item[0], $item[1]);
    }
    
    if( !($item instanceof Core_Model_Item_Abstract) )
    {
      if( $throw ) {
        throw new Activity_Model_Exception('Not an item');
      } else {
        return false;
      }
    }

    return $item;
  }
}